<div class="layuimini-container layuimini-page-anim">
    <div class="layuimini-main">
        <!--用户id-->
        <input type="hidden" id="userId" value="1">
        <div class="order-detail-topbar clearfix" style="margin-bottom: 5px;">
            <div class="pull-left">
                <span class="order-name mr-5">曹涵</span>
                <span class="order-id color-gray mr-5">ID:43222</span>
                <span class="layui-badge layui-bg-darkblue mr-5">候选人</span>
                <button class="layui-btn layui-btn-primary layui-btn-xs"><i class="fa fa-envelope"></i> 查看</button>
                <button class="layui-btn layui-btn-primary layui-btn-xs"><i class="fa fa-phone"></i> 查看</button>
                <a href="javascript:history.go(-1);" class="go-back"><i class="fa fa-angle-double-left"></i></a>
            </div>
            <div class="pull-right">
                <button type="button" class="layui-btn layui-btn-xs layui-btn-primary"><i class="fa fa-star-o"></i> 关注</button>
                <button type="button" class="layui-btn layui-btn-xs layui-btn-primary edit"><i class="fa fa-pencil"></i> 编辑</button>
                <button type="button" class="layui-btn layui-btn-xs layui-btn-primary"><i class="fa fa-mail-forward"></i> 加入订单</button>
                <button type="button" class="layui-btn layui-btn-xs layui-btn-primary"><i class="fa fa-clock-o"></i> <span>1</span> 提醒</button>
                <button type="button" class="layui-btn layui-btn-xs layui-btn-primary remark"><i class="fa fa-comments"></i> <span>1</span> 备注</button>
                <button type="button" class="layui-btn layui-btn-xs layui-btn-primary"><i class="fa fa-paperclip"></i> <span>2</span> 附件</button>
                <button type="button" class="layui-btn layui-btn-xs layui-btn-primary"><i class="fa fa-th-large"></i> 更多</button>
            </div>
        </div>
        <!--设置标签-->
        <div class="set-label-wrap pt-10 pb-10">
            <div class="layui-row layui-col-space10">
                <div class="layui-col-md1 text-right pt-10 color-green">设置标签:</div>
                <div class="layui-col-md5">
                    <button type="button" class="layui-btn layui-btn-xs layui-btn-primary"><i class="fa fa-pencil"></i> 标签</button>
                </div>
            </div>
        </div>
        <div class="layui-row layui-col-space10">
            <div class="layui-col-md9">
                <div class="layui-tab layui-tab-card order-detail-tab" lay-filter="mainTnfoTab">
                    <ul class="layui-tab-title">
                        <li class="layui-this" lay-id="0">简历原件</li>
                        <li lay-id="1">标准简历</li>
                        <li lay-id="2">参与订单</li>
                        <li lay-id="3">通话记录</li>
                        <li lay-id="4">提醒</li>
                        <li lay-id="5">日志</li>
                    </ul>
                    <div class="layui-tab-content">
                        <div class="layui-tab-item layui-show" lay-id="0"></div>
                        <div class="layui-tab-item" lay-id="1"></div>
                        <div class="layui-tab-item" lay-id="2"></div>
                        <div class="layui-tab-item" lay-id="3"></div>
                        <div class="layui-tab-item" lay-id="4"></div>
                        <div class="layui-tab-item" lay-id="5"></div>
                        <div class="layui-tab-item" lay-id="6"></div>
                    </div>
                </div>
            </div>
            <div class="layui-col-md3">
                <div class="resume-info-right">
                    <div class="layui-card">
                        <div class="layui-card-header mb-10">
                            <span>新增备注</span>
                            <a href="javascript:;" class="color-blue pull-right">显示列表人才</a>
                        </div>
                        <!--备注列表-->
                        <div class="layui-card">
                            <div class="layui-card-header">
                                <span class="layui-badge layui-bg-lightgreen">订单备注</span>
                                <span class="layui-badge layui-bg-lightgreen">Defined</span>
                                <span>订单: <a class="color-blue">tim项目</a></span>
                            </div>
                            <div class="layui-card-body">
                                <div>面试时间：2020/3/30 14:16:00%面试结果：no show%面试地址或方式：1312%面试反馈：12</div>
                                <div class="text-right">
                                    <span class="color-gray">2020-04-21 15:17</span>
                                    <a class="color-blue">Administrator</a>
                                </div>
                            </div>
                        </div>
                        <div class="layui-card">
                            <div class="layui-card-header">
                                <span class="layui-badge layui-bg-lightgreen">订单备注</span>
                                <span class="layui-badge layui-bg-lightgreen">Defined</span>
                                <span>订单: <a class="color-blue">tim项目</a></span>
                            </div>
                            <div class="layui-card-body">
                                <div>面试时间：2020/3/30 14:16:00%面试结果：no show%面试地址或方式：1312%面试反馈：12</div>
                                <div class="text-right">
                                    <span class="color-gray">2020-04-21 15:17</span>
                                    <a class="color-blue">Administrator</a>
                                </div>
                            </div>
                        </div>

                        <!--人才列表-->
                        <ul class="ri-list">
                            <li><a layuimini-href="" class="color-blue">何欣怡</a></li>
                            <li><a layuimini-href="" class="color-blue">何欣怡</a></li>
                            <li><a layuimini-href="" class="color-blue">何欣怡</a></li>
                            <li><a layuimini-href="" class="color-blue">何欣怡</a></li>
                            <li><a layuimini-href="" class="color-blue">何欣怡</a></li>
                            <li><a layuimini-href="" class="color-blue">何欣怡</a></li>
                            <li><a layuimini-href="" class="color-blue">何欣怡</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    layui.use(['layer','form', 'table','miniPage','element'], function () {
        var $ = layui.jquery,
            layer = layui.layer,
            form = layui.form,
            table = layui.table,
            miniPage = layui.miniPage,
            element = layui.element;

        /**
         * 初始化表单，要加上，不然刷新部分组件可能会不加载
         */
        form.render();

        //默认显示tab
        (function () {
            showInfoTab(0);
        })();

        function showInfoTab(index) {
            //初始的时候显示的内容url
            var initContent = miniPage.getHrefContent('page/talent/details/resumeOriginal.html');
            if (initContent) {
                element.tabChange('mainTnfoTab', index);
                $('[lay-filter="mainTnfoTab"]').find('.layui-tab-item[lay-id='+ index +']').html(initContent);
            }
        }

        element.on('tab(mainTnfoTab)', function(data){
            var $tab = $(data.elem);
            var index = data.index;
            var content = '';
            switch(index) {
                case 0:
                    content = miniPage.getHrefContent('page/talent/details/resumeOriginal.html');
                    if (content) {
                        $tab.find('.layui-tab-item').eq(index).html(content);
                    }
                    break;
                case 1:
                    content = miniPage.getHrefContent('page/talent/details/resumeStandard.html');
                    if (content) {
                        $tab.find('.layui-tab-item').eq(index).html(content);
                    }
                    break;
                case 2:
                    content = miniPage.getHrefContent('page/talent/details/resumeOrder.html');
                    if (content) {
                        $tab.find('.layui-tab-item').eq(index).html(content);
                    }
                    break;
                case 3:
                    content = miniPage.getHrefContent('page/talent/details/callLog.html');
                    if (content) {
                        $tab.find('.layui-tab-item').eq(index).html(content);
                    }
                    break;
                case 4:
                    content = miniPage.getHrefContent('page/talent/details/remind.html');
                    if (content) {
                        $tab.find('.layui-tab-item').eq(index).html(content);
                    }
                    break;
                case 5:
                    content = miniPage.getHrefContent('page/talent/details/dailyRecord.html');
                    if (content) {
                        $tab.find('.layui-tab-item').eq(index).html(content);
                    }
                    break;
                default:
            }

        });

        // 编辑
        $(document).on("click", ".edit", function() {
            var content = miniPage.getHrefContent('page/talent/add.html');
            if (content) {
                window.userId = $('#userId').val();
                var index = layer.open({
                    title: '编辑候选人',
                    type: 1,
                    shade: 0.2,
                    maxmin:true,
                    area: ['98%', '90%'],
                    content: content,
                    btn: ['确认', '取消'],
                    btnAlign: 'c',
                    success: function (layero, index) {
                        $(window).on("resize", resizeLayer = function () {
                            layer.full(index);
                        });
                    },
                    yes: function(index, layero){
                        window.talentDialogContent.handleSubmitBtnClick();
                    },
                    end: function(){
                        $(window).off("resize", resizeLayer);
                        delete window.resizeLayer;
                        delete window.talentDialogContent;
                        delete window.userId;
                    }
                });
            }
        });

        // 备注
        $(document).on("click", ".remark", function() {
            var content = miniPage.getHrefContent('page/talent/public/remarkTalent.html');
            layer.open({
                title: '添加备注',
                area:['1000px','90%'],
                type: 1,
                shade: 0.2,
                maxmin:true,
                content: content,
                btn: ['确认', '取消'],
                btnAlign: 'c',
                yes: function(index, layero){
                    var $remarkForm = layero.find('.remark-form').not('.layui-hide');
                    $remarkForm.find('[lay-filter="saveBtn"]').click();
                },
            });
        });



    });
</script>
